import request from '@/router/axios';
import { baseUrl } from '@/config/env';
export const loginByUsername = (data) => request({
    url: baseUrl + '/admin/home/login',
    method: 'post',
    meta: {
        isToken: false
    },
    params: {
        account:data.account,
        password:data.password,
        code:data.code,
        redomStr:data.redomStr
    }
});

export const getUserInfo = () => request({
    url: baseUrl + '/sys/sysUser/getUserInfo',
    method: 'get'
});

export const refeshToken = () => request({
    url: baseUrl + '/user/refesh',
    method: 'post'
})

export const getMenu = () => request({
    url: baseUrl + '/sys/sysPermission/list/getUserList',
    method: 'get',
});

export const getTopMenu = () => request({
    url: baseUrl + '/user/getTopMenu',
    method: 'get'
});

export const sendLogs = (list) => request({
    url: baseUrl + '/user/logout',
    method: 'post',
    data: list
})

export const logout = () => request({
    url: baseUrl + '/admin/home/logout',
    meta: {
        isToken: false
    },
    method: 'get'
})
